import WEB3 from 'web3';
// import {WalletList} from './compiled/WalletList.json';
// import Work from '../src/compiled/Work.json';
import { WalletListABI } from './compiled/WalletListABI.js';
import address from './address';

// import IceNotification from '@icedesign/notification';

// let web3 = new WEB3("http://127.0.0.1:7545");
let web3;
if(window.web3) {
  web3 = new WEB3(window.web3.currentProvider);
}else {
  IceNotification.warning({
      message: '没有检测到以太坊插件',
      description: '请安装metaMask或者激活'
  });
}

let walletListContract = new web3.eth.Contract(WalletListABI, address);
console.log(walletListContract);
// let getWorkContract = (addr) => new web3.eth.Contract(Work.abi, addr);

export {
  web3,
  walletListContract
}